fix for queries