Fixed issue when calling a JS function in a native object