get onInsert and onUpdate to work