fix the EOF bug and orgnize file in YYYYMMDD directory