fix "object error" on insert and update