making sure that if no attributes are specified, the attribute names are still printed as headers for csv