fix redirect problems