fix bug that would fail to replace two different smileys due to unknown globals