added better boolean test