add Flush method.
Merge pull request #2 from koyachi/fix_flush

Thanks for your pr.