fix detection of the EOL token