Fixed important bug that data has not been copied properly