register and login almost complete