fixed error in if