Fixed bad if statement