added check if newMsgId is array