fix redirection's bug