better js loop to call tracking