dtw bug fix