Fix against empty query_record