fixing issue unlinking non-existant directories