Fixed updating index