added search query database method