fixed IF problem