fix for empty queries