Added a couple lines to gracefully handle authentication issues.