Fixed bug in mds