Improve file saving