Solved processing dialog twice