check for errors when querying database;
if db results don't keep querying database
file status fixes