change msg to output, typo from cut paste from old code