Thread safe instance variable for setting

Replaced previous class variables to instance variables for thread safety.