I have attached a patch for the same. Please review.