added debug for the case where sorting fails due to naive dates.