Fixed query in dao