new Dialog and setting function