listen to events after defining received and buffers