add headers on error