fix error on the nonexistence of a default directory