Added logout feature (but there are JS console errors)