LPS-49338 Fix incorrect logic