ensure flushing any pending input data if any