fixed everything but the buffer garbage from writing 2 multiple events