fixing error on index