fixed message parsing