Updated logic for get directories. Tweaked the UI.