fixed error in conditions