This is a simple fix .  We can just loop until we have a statuscode that is not a redirect.