change NetworkManager to JS