removed duplicated script code