first working version of fix_post_headers