Fix JS to not leak global