Router.configure({
  layoutTemplate: 'layout',
  loadingTemplate: 'loading',
  notFoundTemplate: 'notFound',
  waitOn: function() {
    Meteor.subscribe('bets');
    Meteor.subscribe('betNotifications');
  },
});

var notLoggedIn = function(){
  if( !Meteor.user() ){
    Router.go('welcome');
  }
}

Router.onBeforeAction('dataNotFound', { only: 'singleBet' });
Router.onBeforeAction(notLoggedIn, { except: [ 'welcome' ] })

Router.map(function(){
  this.route('home', {
    path: '/',
    waitOn: function(){
      Meteor.subscribe('betNotifications');
    }
  });

  this.route('welcome', {
    path: '/welcome'
  });

  this.route('betsList', {
    path: '/bets'
  });

  this.route('dashboard', {
    path: 'dashboard',
    waitOn: function(){
      Meteor.subscribe('betNotifications');
    },
  });

  this.route('createBetForm', {
    path: 'bet',
    data: function(){
      Meteor.subscribe('allUsernames');
      Meteor.subscribe('images');
    }
  });

  this.route('/bets/:_id', {
    name: 'singleBet',
    waitOn: function(){
      Meteor.subscribe('messages');
      Meteor.subscribe('images');
    },
    data: function(){
      return Bets.findOne(this.params._id);
    }
  });

  this.route('/notifications', {
    name: 'notifications',
    waitOn: function(){
      Meteor.subscribe('betNotifications');
    },
  });

  this.route('/messages', {
    name: 'messages',
    waitOn: function(){
      Meteor.subscribe('messages');
    },
  });
});


@@ -291,13 +291,42 @@
 ');%0A
+  %7D else %7B%0A    this.next();%0A
   %7D%0A%7D
+;
 %0A%0ARo

Fix bad route call in router.js