fix login, refactoring errors, and update UI