update js closure