Re-fixed the IF statement