Fixing bug in line 300 for msg undefined.