moved field.state to last place in CustomField constructor