Added commit after each 1000 inserts