Fixed secure redirect issue