Added checking of token