fix attempt for issue #3592 by closing instances at startup