fixed race when injecting scripts, but with copy and paste