fix register and login issues