fix afterQuery