add function: search through database