added dependency check for components on attach/remove