corrected boolean check