lots of database error catching