bug at counting, dialog doesnt reshow