one more unit test and fixed a bug