fix bug in exporting statistics in commandline