Updated buffer handler to support multiple events in a single packet