fixed a serious dwt bug