fixes using a variable which was not set but was being called