add tests for dispatching