added stync.write for writing a full message