fixed bug on index