Changed log writing logic
Updated report and handaling errors exeption