fix bug in StatementProcessor; write statictics in csv file