Removed the  function. Added a check for a local model instance.