improve _check_boolean method in preprocessing