ondata event, shutdown method