fix global variable leaks reported by nodejs