fixed redirect bug