added sign in and out logic