Converting int into textmesh string (c#)

I’m trying to convert an int value into a string to use it in a textmesh but while the code runs and doesnt come up with any errors the text isn’t changed. here is the code.

	GameObject to = Instantiate (Resources.Load("textObj"),gameObject.transform.position,Quaternion.identity) as GameObject;
		to.GetComponent<TextMesh> ().text = baseDam.ToString();

the text mesh still reads “hello world” rather than the baseDam value whats going wrong?

False alarm sorry I was checking the wrong object the above code works fine!