fix sorting of timestamps