fix redirect issues