change serialize logic in dispatcher