programmatically adds checked attribute.