prepare to show dialog