Fixed the temporary file creation