Fix sort by deadline