flush() call added