Add flush method

Added a ````flush()```` method