added check for users home directory to exist before attempting to place files in the folder