fix issue when directory no longer exists