removes directories when finished