change for loop to use lodash's for each

changed the write Result to use lodash for each when iterating over uri errors