add log before dispatchMessage