                     ensures that buffer time is bigger than than the time to download 2 fragments from level j, if we keep same bandwidth
                   */
                   for(var j:Number = current_level-1; j > 0; j--) {
-                     if( _levels[j].bitrate <= last_bandwidth && (bufferratio > 2*_levels[j].bitrate/last_bandwidth)) {
+                     if( _bitrate[j] <= last_bandwidth && (bufferratio > 2*_bitrate[j]/last_bandwidth)) {
                           Log.txt("switch to level " + j);
                           return j;
                       }

               the condition (bufferratio > 2*_levels[_level+1].bitrate/_last_bandwidth)
               ensures that buffer time is bigger than than the time to download 2 fragments from current_level+1, if we keep same bandwidth
            */
            if((current_level < _levels.length-1) && (fetchratio > (1+_switchup[current_level])) && (bufferratio > 2*_levels[current_level+1].bitrate/last_bandwidth)) {
               //Log.txt("fetchratio:> 1+_switchup[_level]="+(1+_switchup[current_level]));
               //Log.txt("switch to level " + (current_level+1));
                  //level up


        /** Reference to the HLS controller. **/
        private var _hls:HLS;
        /** switch up threshold **/
        private var _switchup:Array = null;
        /** switch down threshold **/
        private var _switchdown:Array = null;
        /** bitrate array **/
        private var _bitrate:Array = null;
        /** nb level **/
        private var _nbLevel:Number = 0;
        /** lowest non audio level **/
        private var _lowestNonAudioLevel:Number = -1;

        /** Create the loader. **/
        public function AutoLevelManager(hls:HLS):void {
