fixed query with empty criteria