fixed bug in index changes