changed instance variable to local variable