fixed a bug when accessing fields that exist but have no value
added export functionality