fixed script issues