implemented check for folder

to prevent getFolder() from listing all folders in the root path.