added flatten to merge s3 key with json if possible