Prevent inline script from starting before external scripts have finished loading