The solution proposed by me is in the patch , please review and add comments