fix bug in ErrDMJ