Added checks for correct instance count when adding new data.