Fixed a problem with conditional if