Reference an instantiated UI publically

I am trying to create a healthbar UI using a slider, I want it to Instantiate above an enemy and I want the enemy script to reference that instance so that I can update its transform, I want to instantiate it in the start method and then update it’s script in the update method.

public Slider healthbar // prefab
public Slider newHealthBar // I want to assign the instantiated one to this so that I can update it

void Start() {
newHealthBar = Instantiate(healthbar,Camera.main.WorldToViewportPoint(transform.position) , healthbar.transform.rotation, GameObject.FindGameObjectWithTag("Canvas").transform);
}

When I try to run this code it tells me that I am not assigning the reference

I have figured out the issue in this case, I simply didn’t set the canvas tag