fixed JS error Cannot read property 'right' of undefined [Closes #16]