Actual dialog implementation, close button, initialization