added logic for report.