fix issue when trying to fetch data if no data is available