fixed bug of not updating after midnight but before 7