Now correctly deletes temporary directory when finished