handle "null" and "undefined" properties when querying