some dispatch code tweaks