LPS-36122 fix redirect logic