a fix for handling db error conditions