add unit test
fix warning