save modified index