put permissions dialog inside the form element - should fix issue #444