monkey patch for delete_by_query