fix issue with broken queries when an empty object is passed in as criteria