check for nullity when querying by value