add return infos for header function
fix bug & add flush test scripts