change redirecting logic