fixed infinite header redirects