fix for deleting directories