add setUIfunction constructor