Wrap the "wrap inner" function in a  function that checks if linked in has loaded or not