fixed the IF