'this' reference broke with browserify, updated to 'window'