2 queries with counters

On the advise of Robert and Pieter I rewrote the loops using WP_Query instead of query_posts. It works now. Thanks guys.

Here’s the code:

    <ul class="tabs">
                        <li class="tab-link current" data-tab="tab-1">Most Popular</li>
                        <li class="tab-link" data-tab="tab-2">Recent</li>

                    </ul>




                    <div id="tab-1" class="tab-content current">
                    <div class="slider">
                        <div class="slide">
                        <?php

                        $count = 0;

                        $query = new WP_Query( 
                        array( 
                        'meta_key' => 'post_views_count',
                        'orderby' => 'meta_value_num',
                        'order' => 'DESC',
                        'post_type' => 'atls_video',
                        'posts_per_page' => '-1'
                                 ) );



while ( $query->have_posts() ) : $query->the_post();
$count++; ?>
                            <?php if ($count%6== 0) : ?>
                                <div class="video-entry m-all t-1of2 d-1of3 cf">
                                    <div class="video-thumb">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>"><?php the_post_thumbnail( 'video-thumb' ); ?></a>
                                    </div>
                                    <div class="video-text">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="title"><?php the_title(); ?></a>
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="read-more">Read More</a>
                                    </div>
                                </div>
                            </div>
                            <div class="slide">

                            <?php else : ?>
                                <div class="video-entry m-all t-1of2 d-1of3 cf">
                                    <div class="video-thumb">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>"><?php the_post_thumbnail( 'video-thumb' ); ?></a>
                                    </div>
                                    <div class="video-text">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="title"><?php the_title(); ?></a>
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="read-more">Read More</a>
                                    </div>
                                </div>

                            <?php endif; ?>
                            <?php endwhile; ?>
                            <?php wp_reset_postdata();?>
                        </div>


                        <div style="clear:both;"></div>



                    </div>
                    </div>






                    <div id="tab-2" class="tab-content">
                    <div class="slider">
                        <div class="slide">
                                <?php

                        $count = 0;

                        $query = new WP_Query( 
                        array( 
                        'orderby' => 'date',
                        'order' => 'DESC',
                        'post_type' => 'atls_video',
                        'posts_per_page' => '-1'
                                 ) );



while ( $query->have_posts() ) : $query->the_post();
$count++; ?>

                            <?php if ($count%6== 0) : ?>
                                <div class="video-entry m-all t-1of2 d-1of3 cf">
                                    <div class="video-thumb">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>"><?php the_post_thumbnail( 'video-thumb' ); ?></a>
                                    </div>
                                    <div class="video-text">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="title"><?php the_title(); ?></a>
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="read-more">Read More</a>
                                    </div>
                                </div>
                            </div>
                            <div class="slide">

                            <?php else : ?>
                                <div class="video-entry m-all t-1of2 d-1of3 cf">
                                    <div class="video-thumb">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>"><?php the_post_thumbnail( 'video-thumb' ); ?></a>
                                    </div>
                                    <div class="video-text">
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="title"><?php the_title(); ?></a>
                                        <a href="https://wordpress.stackexchange.com/questions/172351/<?php the_permalink(); ?>" class="read-more">Read More</a>
                                    </div>
                                </div>

                            <?php endif; ?>
                            <?php endwhile; wp_reset_postdata();?>
                        </div>


                        <div style="clear:both;"></div>
                    </div>
                    </div>