add unit test for fn