fixed https redirect bug