Fixing the redirect issue