Logging errors in case of close and open browsers