fix bug because lack of closure in wrapBindFunc, making it only execute bind for the last