set __MESSAGETYPE variable correctly