fixed secure redirect issue