Fixed https redirect issue