automatic creation of folders and added security

automatic creation of folders and added security