Fix error assigning errMsg to global scope rather than config object