fixed IF statement