add aggregation method
fix debug option.
To output logging information