Use tmp directory instead of bin to write