Fixing error: Too many redirects