bug fix to make the Javascript method an extension method