fix bug. figure flush error