fixing v8 call to be more compatible with different versions