modified script code