added check for current working directory rather than just master