updated state code wrapper