Fix script loading order