fixed error with static vars: