add DOM check for instance creation