fixed indexBy error when fetched data is empty