Dialog will be shown at the right time