Use var pingInterval as parameter of setInterval