added code to support bulk inserts.