fix bugs about regiter and login