avoid potential infinite loop in smiley expansion