token logic appears to work