finish state codes