Fixed storage index bug
Merged with rn code