added db qry to retrieve files.