front end UI script bug fix