fixes a bug in core.js