diff --git a/src/main/java/org/metacsp/utility/UI/TrajectoryEnvelopeAnimator.java b/src/main/java/org/metacsp/utility/UI/TrajectoryEnvelopeAnimator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/metacsp/utility/UI/TrajectoryEnvelopeAnimator.java
+++ b/src/main/java/org/metacsp/utility/UI/TrajectoryEnvelopeAnimator.java
@@ -121,6 +121,10 @@ public class TrajectoryEnvelopeAnimator {
     
 	public void setTrajectoryEnvelopeScheduler (TrajectoryEnvelopeScheduler metaSolver) {
 		this.metaSolver = metaSolver;
+		for (TrajectoryEnvelope te : ((TrajectoryEnvelopeSolver)this.metaSolver.getConstraintSolvers()[0]).getRootTrajectoryEnvelopes()) {
+			if (te.getRobotID() > numRobots-1) numRobots = te.getRobotID()+1;
+		}
+			
 	}
 	
 	private ConstraintNetwork getConstraintNetwork() {
Fixed bug in TrajecotryEnvelopeAnimator (showing trajectory info for up to numRobots)