fix the register bug, finish user register and login