Changed get_trip javascript function