add isDefined function