modify sign out to deal with crash case.

modify sign out to deal with crash case.