Data rendered after template

as login, I use accounts-facebook; so I note that the data rendered from Facebook as name, first name arrive a lite bit late than template in local and much more at ; but the picture appear 1 by 7 times when I do make this code


// if (Meteor.user()) {
var id = Meteor.user();
var img = ‘’ + id + ‘/picture?type=square&height=30&width=30’;
// document.getElementById(“img”).src = img;
$("#img").attr(‘src’, img);
// }


the once when it work, its ok; the rest it throw a error in client

Exception from Tracker afterFlush function:
debug.js:41 TypeError: Cannot read property 'services' of undefined

at null. (minute.js:362)
at template.js:116
at Function.Template._withTemplateInstanceFunc (template.js:457)
at fireCallbacks (template.js:112)
at null. (template.js:205)
at view.js:107
at Object.Blaze._withCurrentView (view.js:538)
at view.js:106

in local; name appears but when deployed at; it take a lot time to rendere the data as name; the pic doesnt work correctly in the local and at;

is there a coorect way to fix this, thank’s for your help