finish signin/signout function