Added the log out function and fixed the user interaction with the items