fix reset indices bug