some db error handling