fixed headers and encoding