add message writing
Merge branch 'raysmond'