fix error when insert before is turned off.