Clouse the output stream when completed and avoided temp folder