fixed bugs in unitTest