clean up addDataFunction