I solved my issue by creating a private function I pass my variable into, rather than using the class variable, but I'm still happy to hear other suggestions.