Fixing non-saving index bug