Some improvements

Please review before merge,
adding connection error handling,
close button,
and avoid same reports.

Thanks.