modify to work around Directory issues.