fixing bug with nil attributes serialization