added support for determining edit v. add