fix another bug. unit tests pass.