added auto_edit for insert