added base funtion for token handler