fix issue with tokens generated being reported as invalid