fix endless redirect loops