fix terminate arguments on _handleSafeExit