Instantiate dialog only if it's active.
Merge pull request #2 from pkaminski/master

Instantiate dialog only if it's active.