fix bug in unit test