Fix JS bug in cbp.js