use the correctly determined buffer size