LPS-49338 Revert LPS-13464
LPS-49338 Fix incorrect logic