Fix bugs in logout after refactoring home()