Add check for NULL value in attribute to ignore those attributes