error reporting and session fixing