             shaft_status[shaft].steps_to_move = -shaft_status[shaft].steps_to_up; // return it to the center
             do_steps(); // (it will be the only motor to move)
          } } }
-   write_config(config_hdr.lastfilenum); // write the shaft calibration data
+   write_config(); // write the shaft calibration data
    info_message("calibration saved", 0); }
 
 void center_all_shafts(void) {

      for (int loc = 0; loc < EEPROM_SIZE; ++loc)
         EEPROM.update(loc, 0); } }

void write_config(int filenum) {
   int toloc = 0;
   strcpy(config_hdr.id, "cfg");
   config_hdr.size = CONFIG_SIZE;
   config_hdr.numshafts = NUM_SHAFTS;
   config_hdr.numtreadles = NUM_TREADLES;
   config_hdr.maxsequence = MAX_SEQUENCE;
   config_hdr.lastfilenum = filenum;
   memset(config_hdr.unused, 0, sizeof(config_hdr.unused));
   write_EEPROM(&toloc, (char *) &config_hdr, sizeof(config_hdr));
   write_EEPROM(&toloc, (char *) shaft_status, sizeof(shaft_status));

   read_EEPROM(&fromloc, (char*) tieup, sizeof(tieup));
   read_EEPROM(&fromloc, (char*) treadle_sequence, sizeof(treadle_sequence));
   cleanup_treadle_sequence();
   config_hdr.lastfilenum = filenum;
   strcpy(last_filename, file_hdr.filename);
   unsaved_file = false;
   if (DEBUG) dump_file("file read:"); }

void display_files (int filenum) {
