Add isDefined function