wrapped buffer in struct to avoid last mem mistake