workaround an issue when compiled to JS
Merge pull request #1350 from devoncarew/devoncarew_workaround_js_bug

workaround an issue when compiled to JS