length writing fix