fixed broken IF statements