fix the redirect issue