check that string exists before doing html strip