Better handling of token expiration