Make openDialog() can be reused.