Fixing redirect issue