fix endless redirect