attempt fix bug: cPickle.PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function faile