set observer before dialog.show()