fix _flush method