add the dist_s to global value