fixed the redirect errors