handle bad strings in a right way