add callback to close; add setDiffDeep and setArrayDiffDeep