added search function to db class