vidision by zero fix; wrapped saving into db in transactions