Fixed the removal of the temporary file