declare getOutput as const and flush output queue in flush()