fix too many redirects problem