(Revised Commit) - Added logout feature (but there are JS console errors)