plain solution for the dialog bug

plain solution for the dialog bug, cleaner verison =)