var createBetNotification = function(bet){
  var bet = Bets.findOne({ _id: bet });

  BetNotifications.insert({
    toNotify: bet.bettors[1],
    betBy: bet.bettors[0],
    bet: bet._id
  });
}

Template.createBetForm.events({
  "submit .create-bet" : function(event){
    event.preventDefault();

    var title = event.target.betTitle.value,
        wager = event.target.betWager.value,
        user = Meteor.user(),
        username = user.username,
        defender = event.target.defender.value;

    Meteor.call("createBet", username, defender, title, wager)

    Router.go('/bets')

  }
});

@@ -494,16 +494,189 @@
 value;%0A%0A
+    if (Meteor.users.find(%7Busername: defender%7D).count() === 0)%7B%0A%0A      throw new Meteor.Error(alert( %22Sorry the Username you are trying to challenge is not valid!%22))%0A    %7D%0A%0A
     Mete

throw error if you try to challenge an invalid user name