fix writing headers for list & map