added automatic removal of tmp folder