LPS-32915 Fix incorrect logic