LPS-34666 Adjusted the logic