Some change to javascript to work in node