Variable does not change on the client

I think I understand what the problem is, I constantly create new widgets, so the variable is constantly overwritten and “does not change”