Updating Palette Plugin with multiple documents

I’m coding a Palette Plugin and I’m facing a problem.

When I Open GlyphApp, the first opened document will have the plugin correctly displayed.
If I open a second document, some elements are missing (the missing elements are draw in a update function)

If I change currentDocument, the plugin palette of the first opened project is updated with datas from the currentDocument. Here is a screen record to understand better.

How can I fix it ?
For sure it’s something in def update(self, sender), because horizontal lines placed in def settings(self) are drawn. I suspect it has something to do with the sender.