add URI escaping to Dir.pwd calls to control for paths with spaces