buffer init fix