modified file saving