Attempt at solving infinite redirects