fix error

fix the click "tempfile" folder unexpectedly exit error.
code cleanup
Merge pull request #110 from Logan676/lg2

fix unexpected exit error