Added some checks to avoid manipulation of the attributes