save to tmp file