fix the end time and effective distance problems