added flush()