Added wraping function to tokenHandler