added a helper method for getting an attribute