added script bug fix