rewrite to allow poll_header input