fix a redirect bug