Added buffer flush timeout