My components are disappears

I am instantiating a prefab and adding a component to it after it is instantiated. I know that it works because in the added components Start function I output a hello message. But later when the object collides into my player, I call a function from the added component of the collided game object to output a message but I receive a null exception reference. Looking at the hierarchy of the Instantiated game object it does not have my added component?

Any ideas on what could be problem? I am using the latest version of Unity

I call a function from the added component of the collided game object to output a message but I receive a null exception reference.

Sounds like your component have forgot to set a variable.

Looking at the hierarchy of the Instantiated game object it does not have my added component?

Maybe you hid it using hideFlags so it does not show in inspector. Most likely you called AddComponent on the wrong game object. Example of how you could perhaps got it wrong:

var clone = Instantiate(prefab);
gameObject.AddComponent<HelloWorld>();

// ... but should have been ...
clone.AddComponent<HelloWorld>();