Added logout functionality to call from the logout button in the navbar