fix few difference between the coffeescript code & the ruby code