removed getDirs function and replaced with Window.folders API call