replace and insert component