replace /tmp/ with createTempFile