added isDefined and isWrapped functions