Fix undefined variable

It is `$text_parts` and not `$text_part`