Better tmp folder handling