fixed query for local