tighter boolean check