use the schema eachpath function rather than toobject