db error handling corrected (lazy error)