modify peek_event to pump_event