Fixed issue from getting data from db with index.