Add redirecting logic