bug fixed for calc MSD