Correct the code for unit testing