adds required attribute