fix bad directory structure automatically