- Moved text attributes dictionary creation to if statement