updated script to work with new UI