moved signout up so it gets called if a exceptions ocures or not.