fixed script errors