renamed query database to query all