script fix from spgh