apply-message fn