Changed file saving method