add scan functionality