fixed aborting a script when it opened a widget for painting