Fixed sign in sign out logic in layout view