refine message type handling
refine message type handling
fix typo