Foundation object exists already. : fine tune reward weights by running launch_hydra iteretively

I am trying to fine tune my reward weights by calling the launch_hydra function in the training script many time for different parameters. However after the first iteration I get this error. Do after max epochs have been reached and the launch_hydra function has been called again.

/buildAgent/work/99bede84aa0a52c2/source/foundation/FdFoundation.cpp invalid operation : Foundation object exists already. Only one instance per process can be created.

How can. I manually delete the foundation object as it seems to not be done automatically.