Added auto-token refresh