fix javascript issue

fixes #175
fixes #176