added a protected function `dispatch` for extension.