query fix according the task