clean up .directory files properly