fix login refactoring bugs; update UI