Added single sign on, and fixed Application Delegate so that login works more than once