added a check for null pointer exception in Abstract Attribute