Update bar.js

fixes #6