modify index finally