Updated undefined check for collection support