fixes for token refresh