DND function bug fixed.