"if" condition fixed