fixes to post flag logic