proper temp files and more robuts path handling on windows