handle shifts over midnight