fix a bug about register and login