change hsv_thre to green and insert wait function