add comditional to make sure value passed in is a valid attribute.