fix bug in test method