fix popToIndex range for removal