title: Meteor application crashing while calling last message
body: <p>In one of controller I'm trying to list all online users and their last message. But the browser is unresponsive while running the below code.</p>
  
  <p>In app.js</p>
  
  <pre><code>angular.module('jaarvis').controller('OnlineUsersCtrl', ['$scope', '$meteor', function ($scope, $meteor) {
    $scope.$meteorSubscribe('users');
    $scope.$meteorSubscribe('chats');
    var query = {};
    query['status.online'] = true;
    var online = $meteor.collection(function(){
      return Meteor.users.find(query, {fields: {'_id':1, 'profile.name':1, 'status.online':1}});
    });
    $scope.onlineusers = online;
  
    $scope.getLastMessage = function(userId) {
     var query = {};
     query['uid'] = userId;
     var lastMessage = $meteor.collection(function(){
        return Chats.find({'uid':userId}, {fields: {'content':1}}, {sort: {'_id': -1}, limit: 1});
     });
     return lastMessage;
    };
  }]);
  </code></pre>
  
  <p>In HTML</p>
  
  <pre><code>&lt;div class="list"&gt;
  
                  &lt;a class="item item-avatar" href="/onetoonechat/{{onlineuser._id}}" ng-repeat="onlineuser in onlineusers"&gt;
                    &lt;img src="venkman.jpg"&gt;
                    &lt;h2&gt;{{onlineuser.profile.name}}&lt;/h2&gt;
                    &lt;p&gt;{{ getLastMessage(onlineuser._id) }}&lt;/p&gt;
                  &lt;/a&gt;
                &lt;/div&gt;
  </code></pre>
  
  <p>Correct if there is any mistake in my code or provide alternative solution.</p>