fixed register and login bugs