diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js
index fbb6625..5a4228b 100644
--- a/IPython/html/static/widgets/js/widget.js
+++ b/IPython/html/static/widgets/js/widget.js
@@ -152,11 +152,12 @@ define(["widgets/js/manager",
var attrs = (method === 'patch') ? options.attrs : model.toJSON(options);
if (this.state_lock !== null) {
var keys = Object.keys(this.state_lock);
- for (var i=0; i