add login and fix minor bugs