Customizing 3d views with qt widgets not working properly

I have a layout in which there are three 3d views.I want to put a button(load DICOM) in the topbar(barLayout) of the first threeDView.But when I am running my code many time the button is coming in second or third view node too.Why is this happening?

This is my code.But the button is coming in the other windows when close the gui and run again.

Screenshot from 2020-09-05 11-19-31 Screenshot from 2020-09-05 11-20-02

Is this because I not clearing the instances, the slicer is giving me some warnings.
Screenshot from 2020-09-05 11-20-36

theeDWidget(0) may refer to any of the views. Check the associated view node to determine which view are you actually modifying.

The “Class … has … instance still around” means you have a memory leak in your code: you created a VTK object, added references to it, and have not removed all references before exiting the application. Check out this page for more details. This is not related to which view controller widgets the extra button shows up at.