add handle-message fn