Fix adding and editing rootDirs

Fix adding and editing rootDirs.

Moved the buttons outside the exist check otherwise the function sticks to add or edit.
Prevent empty dir being added