save index before overwriting with all new file