fixed bug in unit test