implement DBL&MsgLoop