bug fix unit testing implementation