fixed bugs in insert_testdata