Instantiate dialog only if it's active.