closure function codec bugfix