Added call to flush