optimize closure function codec
closure function codec bugfix