edit uptoken function