fix main redirect bug