Fix jshint error where msg is not defined