fix for maps and documents as well