Fixed bug on index