Fix bug that script loading begin when add to DOM