Changed query to insert all rows at once.