added flush method