Issue using map(object) variable

Please fix the mangled formatting of your code: Welcome to the forum - please reformat your message