fixed infinite redirect