fix bugs in redirect server