Added code to check if value of an attribute is null. In which case, store the empty string instead of a null, which could later get printed as "null".