fix improper boolean check