I did that and it worked.
On the site with the issue, I have two widgets that use this code, one is working while the other is not.
I just removed it for now since it is not that important for me and I do not have the time to continue debugging it.