bug fix: dialog.next was called twice per click