for bug #199, refine the api of send message.