fix sign in and sign out function