fix ensure/type attribute