fix contour bug