fix bug in errorHandler
add addHeader function to http request object