fix (potential) bug in "new day" check