fix for db models insert and update