fix redirect bug