fixed MD bug