fix leak in dispatch()