added check for path argument