implement header receiving state