Logout functionality and fix clear cache