slightly modify the file saving code