Added handling for token in client