update end index initialization