Add flush method

I added a flush method