Added code address remove/validation logic as recommended in pr 1725