modify redirection code