fixed error with if