compose message logic