fix redirect error.add a sync variable