implement token callback