Adapted to XCode 6 Beta 6 and implemented Sign out