Fixed bug in index