fixing bug in index