fixed issue with dialog not opening when tre-la-la is loaded; removed some duplication