added check for token