-corrected bad if test