Endtime at midnigth bugfix