added login and fix bugs
merged