use correct variable: $folder instead of $folderId