fixed bug out of index