also output end-flag.txt for tray directory