adding content-length on errors