Fix redirection bug