PLD: fix logic and replace only span content