Write to tmp