fixed tm_grid bug, updated NDW