add flush method