Updating javascript so it only calls the pebble when it has updated stats