with tsp error handling complete