Fix behavior when redirected