fix bug in unittest