fix http errors returning html