fixed error with variable change