downloading directories from bucket causes errors

If the s3-bucket contains also nested directories, the download-option causes errors by the lack of a distinction between file and directory.