fixed bug when preferedMessageType was not defined