finished adding login logic
Fixed some bugs