throw proper errors if predicates are used outside where clause