bug fix for Part-B
bug fix