Changed local variable name to prevent redefining a variable passed through the attributes.