fixed headers on errors