Add error checking to database update.