fix bug in test
remove unused code