SEC-2656: fix and unit test