fix optional headers and update doc