How to subscribe to a collection in a router

I am trying to subscribe to a router while at the same time load a view

Router.route('/telemedicine', function() { 
template:'telemedicine',
waitOn: function () 
{ 
return Meteor.subscribe('UserMessages'); 
} 
});

The code reports as an error,not sure why.

Looks like you are using Iron:Router? My recommendation is to use template level subscriptions