fix go 1.1.1 compatiablitly, now store function as pointer