remove useless queries