fixing dao query when no query param is provided