fix crash while delete selected component

* issues introduced while porting