fix script bug