using event for stdout