fix redirect detection error