corrected name length, strlen counts the null character