Fixed error in conditions