fixing redirect issue