add unit test and make check