updated unit test code