fix bug in index