Fix component detaching