patch for token management