fix bug when redirecting.

response needs to end