diff --git a/accordion.js b/accordion.js
index <HASH>..<HASH> 100644
--- a/accordion.js
+++ b/accordion.js
@@ -6,12 +6,18 @@
 	// we're in a CommonJS environment; otherwise we'll just fail out

 	if( vui === undefined ) {

 		if( typeof require === 'function' ) {

-			module.exports = vui = require('../../vui');

+			vui = require('../../vui');

 		} else {

 			throw new Error('load vui first');

 		}

 	}

 

+	// Export the vui object if we're in a CommonJS environment.

+	// It will already be on the window otherwise

+	if( typeof module === 'object' && typeof module.exports === 'object' ) {

+		module.exports = vui;

+	}

+

 	$.widget( "vui.vui_accordion", {

 

 		options: {},
just checking for require isn't necessarily a CommonJS env. could be AMD based