fixed mds code