Fix redirection (needs improvements)