fixed the test code in main