Added query logic, search for null values