bug fixes in new http state machine