compatibility with require.js and browsers