5 nov feature
some cleanups, prevent error at midnight, use right QC flag