changed local variable to instance variable