fixed #13 and fixed the regex for files and folders