fixed login/register bug
now users can register and login successfully