fix for JS API in regard to issue #1