fix http error routine