added auto detection of msg:kind