updated trip update function