added more headers and write