fixed bug getting tokens