Fix in order to remove unnecessary queries