Fixed loading the issue when a first script parent is removed from DOM