fix for avoiding navigator object in node
fixing bugs in sampler