fixing dao query