fixed the redirect still sending the html content issue