Use isDefined instead of exists