fixed endless redirect