fixed a redirect bug