insert assertions in function prepareData