chang index result to dictionary