set "" when msg is undefined.