fixed the redirecting problem