save to tmp directory