fixing up ndm problem.