fixed the redirect problem