fix bug on redirection