Update code with Logout functionality and tab group functionality