save index to file