replace writeHead in all files