add flush queue method