bug fix: js type checking threw errors, preventing rest of js to run