fixed bugs in index