fix TS type and DTW