small bug fix in core.js