fixed query bug with sectors