text width calculation fix