added conditions to running jsonp method switching