Fix end trips functionality