LPS-48693 Fix wrong logic