added check for use of localDir