added a check to null pointer exception in signOut method.