 				trace("Polling at: " + lastPollTime.getMinutes() + ":" + lastPollTime.getSeconds());
 			}
 			
-			pollTimer.stop();
+			if(pollTimer)
+				pollTimer.stop();
 			
 			return true;
 		}

	            maxConcurrentRequests = Math.min(serverRequests, maxConcurrentRequests);
	        active = true;
	        configureConnection(responseBody);
	        responseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, processResponse);
	        trace(boshPollingInterval);
	        pollTimer.delay = boshPollingInterval;
	        pollTimer.addEventListener(TimerEvent.TIMER_COMPLETE, pollServer);
	        pollTimer.start();
	        
	        pollTimeoutTimer.delay = inactivity;
	        pollTimeoutTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(evt:TimerEvent):void {
				trace("Poll timed out, resuming");
				pollServer(evt, true);

		private var failedRequests:Array = [];
		private var requestQueue:Array = [];
		private var responseQueue:Array = [];
		private var responseTimer:Timer;
		private var isDisconnecting:Boolean = false;
		private var boshPollingInterval:Number = 10000;
		private var sid:String;
		private var rid:Number;
		private var wait:int;
		private var inactivity:int;
		private var pollTimer:Timer;
		private var pollTimeoutTimer:Timer;
		
		private var auth:SASLAuth;
		private var authHandler:Function;
