fixed script directory bug