added some message parsing