change MAX_EVENT to 512