Fix script reloading bug