Add logout button and fix login controller