fixed headers and bugs