fetching rows bug fix