Remove unused variables from function in network.js