modified function for signout