improved command line handling & flush unused events