Fix for javascript error

Fixes #6