fix #67 and ability to use closure to fill extraAttributes for pivot table