fixed the attribute() function when passing a variable for the arguments