add send message code, unify the style