fix register and login redirect