bug fixes the the reducers, added more helper functions for loading index