add scan and fix hcurve bug