fix a bug in util.js