Fix script order issue