bugfix for new midnight edge case