fixed the midnight reset problem