Fix bug about file path in Flush method