regression fix: correct written length