fixing bad if