fixed mistakes in util.js