added the function of removing the component