fixed js error (fixes #244)