added logic for response reporting and improved attempt and log code