adding exception handling and AccessToken updates