bug fix on general.js