fixed script bug