Fix user register and login