close #180, sort end date after priority