I have attached a patch with proposed solution. Please review.