fix malformed text