added index when inserting rows and cells for chromium compatibility