Multicast being called before replicating variable

you mean adding the variable as an input of the function?