modified to work with the new UI