made Dialog more dynamic (for other purposes than this)