fix bug index