make curl save file correctly