Used tempfile module for compatability with not unix like systems