Fixed redirect bug